import java.io.File;
import java.io.IOException;

public class TestDemo2 {
    public static void main(String[] args) throws IOException {
        File file = new File("./hello_world.txt");
        System.out.println(file.exists());
        System.out.println(file.isDirectory());
        System.out.println(file.isFile());

        file.createNewFile();

        System.out.println(file.exists());
        System.out.println(file.isDirectory());
        System.out.println(file.isFile());

        file.delete();
        System.out.println("删除文件后:");
        System.out.println(file.exists());
    }
}
